The present invention relates to an apparatus for encoding an image, more particularly relates to an image encoder capable of encoding a moving picture at a variable bit rate and a method of the same.
In a general image encoding apparatus, the digitized image signal is encoded at a constant bit rate or at a variable bit rate. A bit stream encoded at a constant bit rate has a constant bit rate and does not depart much from an object bit rate. As opposed to this, a bit stream encoded at a variable bit rate does not have a constant bit rate and varies in accordance with the characteristics of the image signal to be encoded. Note that in this case, compression and encoding are performed on an image signal within a range not exceeding a maximum bit rate subscribed by standards.
When encoding a digitized moving picture signal, encoding bit rate control, that is, control so as to give a desired bit rate when viewing a certain time span of a coding series generated by encoding, is performed. A plurality of standards for compressing and encoding an image signal changing over time, a so-called motion picture, at a high efficiency have been proposed hitherto. Among them, the MPEG2 standard has currently gathered attention and come into practical use in a variety of fields of application such as communication, broadcasting, and media storage. Digital versatile disks (DVD), one of the applications, is expected to be increasingly widely used in the future as recording media for compressing, encoding, and storing motion pictures based on the MPEG2 standard due to its large capacity, low cost, and ease in handling.
The MPEG2 standard does not define the above encoding control for control of the bit rate. Therefore, it is sufficient that the amount of encoded information be within a certain range subscribed by standards. Normally, a variable bit rate is used in authoring DVDs (editing work for preparing a DVD title). The encoding method at this time investigates the encoding difficulty of the source as a whole in a first encoding and performs encoding assigning an amount of code corresponding to the encoding difficulty in the second encoding to realize a variable bit rate. As a result, a larger code amount is assigned to an image signal having a high difficulty, while a code amount assigned to an image signal having a low difficulty is suppressed and therefore uniformity of the image quality can be attained.
In an application recording a motion picture signal obtained by an image pickup like a video camera on a recording medium in real time, the successively input motion picture signal has to be compressed, encoded, and recorded sequentially. In such a case, since the entire image to be encoded cannot be investigated in advance, the image is normally compressed and encoded at a constant bit rate using a fixed code amount for every GOP (group of pictures) in units of, for example, about 15 frames.
FIG. 7 is a view of a view of an encoding rate when encoding an image signal at a constant bit rate. As shown in FIG. 7, when performing compression encoding on an image signal at a constant bit rate, a bit rate of an obtained coding series is made constant to be almost an object bit rate regardless of the characteristics of the image. To realize the constant bit rate, a bit rate control portion of the image encoder rapidly changes a quantizer scale in units of macroblocks comprised of a several blocks for the object bit rate given in advance.
The compression and encoding by a constant bit rate make the bit rate constant regardless of the characteristic of the image signal, therefore the picture quality is good in a scene wherein the encoding difficulty is low, but there is a disadvantage that the picture quality deteriorates in a scene wherein the encoding difficulty is high.
For this reason, it is desired that a bit rate is set variable so that the code amount obtained in compression and encoding falls in a range of a prescribed value while maintaining the picture quality to be not less than a fixed level. FIG. 8 is an example of a bit rate of a coding series obtained by variable bit rate control. In the variable bit rate control, the quantizer scale is controlled for example in units of GOPs fro an object bit rate. Namely, a response speed of the quantizer scale is made slow. As a result, as shown in FIG. 8, the bit rate becomes low in portions where encoding difficulty is low, while the bit rate becomes high in portions where encoding difficulty is high. By changing the bit rate over time in accordance with the encoding difficulty, picture quality of a reproduced image can be maintained to be almost uniform.
In an application like a video camera wherein an image processing is required in real time, however, the characteristics of the entire image signal cannot be investigated in advance. Therefore, the bit rate is set based on experience. Since images obtained from an actual image pickup device changes from moment to moment and the encoding difficulty also changes over time, the encoding bit rate exceeds a maximum bit rate designated at a sequence header at the top of a bit stream in the portions where encoding difficulty is high in some cases. Therefore, it is impossible to generate a bit stream based on standards in all cases merely by making the response speed of the quantizer scale in accordance with changes of encoding difficulty.
Furthermore, when considering an application to consumer goods, a simple algorithm is desired by which a circuit scale of a hardware and processing amount of software are not increased much.
The present invention was made in consideration with such a circumstance and has as an object thereof to provide an image encoder and processing method capable of realizing compression and encoding of a motion picture at a variable bit rate in an application where real time processing is required.
To attain the above object, an image encoder of the present invention claims*.